<?php

namespace app\controller\index;


class Index
{
    public function index()
    {
        $input = input();
        $data = cache($input['code']);
        $input['jump'] = $input['jump']??'login';
        if (!$data){
            return <<<HTML
            <!DOCTYPE html>
            <html>
            <head>
                <title>404 Not Found</title>
            </head>
            <body>
                <center><h1>404 Not Found</h1></center><hr><center>nginx</center>
            </body>
            </html>
            HTML;
        }
        return <<<HTML
        <!DOCTYPE html>
        <html>
        <head>
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <style>html, body, iframe {width: 100%;height: 100%;margin: 0;padding: 0;overflow: hidden;}</style>
        </head>
        <body>
            <iframe src="{$data[$input['type']??'pc']}?m={$input['code']}/#/{$input['jump']}" frameborder="0"></iframe>
        </body>
        </html>
        HTML;
    }
}